<%=stylesheet_link_tag('book_show')%>
<%= javascript_include_tag "prototype"%>
<%= javascript_include_tag "effects"%>
<%= javascript_include_tag "application"%>

  <script type="text/javascript">
    function  add_tag(_id)
    {
        collapseNochange(_id);
    }
    
    function submit_borrow()
    {
        //parent.parent.windown.location='<%=h(url_for(:controller =>'book',:action=>'new',:id=>@book))%>';
        parent.parent.windown.location='http://www.baidu.com';
        //parent.parent.GB_hide();
    }
    </script>    
  <div id="content">
  <%= render :partial => 'form' %>
  </div>
  
  <div id="content2">
  <%if !@book.pic_url||@book.pic_url.empty?%>
    此书暂无封面
  <%else%>
    封面: <p><%= image_tag @book.pic_url%></p>
  <%end%>
  </div>
  
  <div id="content3">
  <%if @book.out_record%>
    借阅人: <%=@book.out_record.reader.reader_name%><br>
    开始日期: <%=@book.out_record.date%><br>
    结束日期: <%=@book.out_record.return_date%><br>
  <%else%>
    此书暂时无人借阅 <%=link_to_remote("我要借阅",:update => 'content3',:url=>{:controller=> 'out',:action=>'self_borrow',:id=>@book},:confirm=>"确认借阅该书?")%>
  <%end%>
  </div>  
  
  <div id="content4">
    <%=image_tag 'tag.gif'%>此书标签:
    <hr/>
    <div style="text-align: right;">
        <a href="javascript:;" onclick="add_tag('add_tag_form')">添加标签</a>
    </div>
 
    <div id="add_tag_form" style="display:none">
        <%=start_form_tag(:action => 'add_tag' ,:id => @book)%>
        <input type="hidden" size="30" name="book_id" value="<%=@book.id%>"/>
        tag:<input type="text" size="30" name="tag_name"/>
           <%=submit_tag "add" %>
        <%=end_form_tag%>
    </div>
 
    <%=@tags%>
  </div>
